/* GUI CONVERTED from rmpvrp.p (converter v1.75) Sat Mar 31 09:12:40 2001 */
/* rmpvrp.p - VENDOR REPORT                                             */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.7.1.6 $                                             */
/*V8:ConvertMode=FullGUIReport                                 */
/* REVISION: 1.0      LAST MODIFIED: 04/05/86   BY: PML        */
/* REVISION: 8.6      LAST MODIFIED: 10/11/97   BY: GYK *K0T5*         */
/* REVISION: 8.6      LAST MODIFIED: 10/29/97   BY: *H1G4* Manish K.   */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.0      LAST MODIFIED: 03/10/99   BY: *M0B3* Michael Amaladhas  */
/* REVISION: 9.0      LAST MODIFIED: 03/13/99   BY: *M0BD* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 06/16/00   BY: *N0C9* Inna Lyubarsky     */
/* REVISION: 9.1      LAST MODIFIED: 08/11/00   BY: *N0KK* jyn                */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.7.1.6 $    BY: Katie Hilbert  DATE: 04/01/01 ECO: *P002* */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/
/* DISPLAY TITLE */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "b+ "}

define variable code like pv_addr.
define variable code1 like pv_addr.
define variable name like ad_name.
define variable name1 like ad_name.
define variable zip like ad_zip.
define variable zip1 like ad_zip.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
code           colon 12
   code1          label {t001.i} colon 46 skip
   name           colon 12
   name1          label {t001.i} colon 46 skip
   zip            colon 12
   zip1           label {t001.i} colon 46 skip
 SKIP(.4)  /*GUI*/
with frame a side-labels attr-space width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

{wbrp01.i}

/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

   if code1 = hi_char then code1 = "".
   if name1 = hi_char then name1 = "".
   if zip1 = hi_char then zip1 = "".

   if c-application-mode <> 'web' then
      
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


   {wbrp06.i &command = update &fields = "  code code1 name name1 zip
          zip1" &frm = "a"}

   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data')) then do:

      bcdparm = "".
      {mfquoter.i code    }
      {mfquoter.i code1   }
      {mfquoter.i name    }
      {mfquoter.i name1   }
      {mfquoter.i zip     }
      {mfquoter.i zip1    }

      if code1 = "" then code1 = hi_char.
      if name1 = "" then name1 = hi_char.
      if zip1 = "" then zip1 = hi_char.

   end.
   /* Select printer */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:



   {mfphead.i}

   for each pv_mstr where (pv_addr >= code and pv_addr <= code1)
         and (pv_sort >= name and pv_sort <= name1)
         no-lock by pv_sort with frame b width 132 no-attr-space no-box:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame b:handle).
      find ad_mstr where ad_addr = pv_addr no-lock.

      if (ad_zip >= zip and ad_zip <= zip1) then do:
         display pv_addr ad_name
            ad_line1 ad_city format "x(24)" ad_state
            ad_zip ad_phone ad_ext WITH STREAM-IO /*GUI*/ .
         if ad_line2 <> "" or ad_attn <> "" or ad_country <> "" then do:
            down 1.

            display getTermLabel("ATTENTION",8) + ": "  + ad_attn @
               ad_name ad_line2 @ ad_line1
               ad_country @ ad_city
               ad_ctry @ ad_state WITH STREAM-IO /*GUI*/ .
         end.
         if ad_line3 <> "" then do:
            down 1.
            display ad_line3 @ ad_line1 WITH STREAM-IO /*GUI*/ .
         end.
         put skip(1).
      end.
      
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

   end.

   /* REPORT TRAILER  */

   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


end.

{wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" code code1 name name1 zip zip1 "} /*Drive the Report*/
